// 定义Goods接口
const goodSymid = Symbol('goodid')
interface Goods {
  [goodSymid]: number
  name: string
  price: number
}

type Record<T> = {
  [P in keyof any]: T
}

type resultGoodsType = Record<Goods>
let goodRecord: Record<Goods> = {}
let good: Goods = { [goodSymid]: 101, name: '苹果', price: 9 }
goodRecord[103] = good
goodRecord['香蕉'] = good
goodRecord[good[goodSymid]] = good
console.log(goodRecord)

for (let goodid in goodRecord) {
  let good = goodRecord[goodid]
  console.log(good.name);
}

export {}
